gnuplot << EOF


# uncomment the next line to output as png image
set terminal png

# save file to "app-slash-happy-metrics-(reqs)-(concurrent).png"
set output "app-slash-happy-metrics-$1-$2.png"

# graph a title
set title "ab -n $1 -c $2 for /app vs / (static) vs /app/happy/ (db access)"

# nicer aspect ratio for image size
   set size 1,0.7

# y-axis grid
   set grid y

# x-axis label
   set xlabel "request"
                                                                                
# ignore the last 1000 values due to a bug in ab                                 
   set xrange [0:10000]                                                          
 
# y-axis label
   set ylabel "response time (ms)"

# plot data from "$3" and "$4" and "$5" using column 9 with smooth sbezier lines
   plot "$3" using 9 smooth sbezier with lines title "app (processing):", "$4" using 9 smooth sbezier with lines title "/ (static):", "$5" using 9 smooth sbezier with lines title "/happy (sql):"

EOF